<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <button>旧元素</button>
</body>
</html>


<script>
    var btn = document.querySelector("button")
    var body = document.querySelector("body")
    var newBtn = btn.cloneNode(true)
    newBtn.innerHTML = "新元素"
    body.appendChild(newBtn)
</script>